<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org/">
<head>
    <meta charset="UTF-8">
    <title>登录页</title>
    <base href="http://localhost:81/resources/front/">

    <link rel="stylesheet" type="text/css" href="css/style.css"/>
    <link rel="stylesheet" type="text/css" href="css/shopping-mall-index.css"/>
    <script type="text/javascript" src="js/jquery.js"></script>
    <script type="text/javascript" src="js/zhonglin.js"></script>
    <script type="text/javascript" src="http://localhost:81/resources/back/lib/layer/1.9.3/layer.js"></script>
    <script src="http://localhost:81/resources/back/js/AjaxUtlis.js" type="text/javascript" charset="utf-8"></script>
    <style>
        #register{
            font-size: 12px;
            margin-left: 160px;
        }
    </style>
    <!--    登录操作-->
    <script>
        function loginBut(){
            // 1.获取表单数据
            var username = $("#username").val();
            var password = $("#password").val();
            var returnUrl = "[[${#request.getParameter('returnUrl')}]]";
            returnUrl = returnUrl?returnUrl:"http://localhost:81/home";

            // 2.校验非空
            if(!username){
                layer.msg('用户名不能为空', {icon: 3, time: 1000});
                return;
            }
            if (!password) {
                layer.msg('密码不能为空', {icon: 3, time: 1000});
                return;
            }
            // 3.封装数据
            var param = new Object();
            param.username=username;
            param.password=password;
            var url = "[[${#request.getParameter('url')}]]";
            console.log(url)
            // 4.发送请求
            post("auth/login",param,function () {
                layer.msg("登录成功", {icon: 1,time:2000},function(){
                    location.href=returnUrl;
                });
            })
        }
    </script>
</head>
<body>

<div class="sign-logo w1200">
    <h1><a href="#" title="宅客微购"><img src="images/logo.jpg" /></a></h1>
</div>

<div class="sign-con w1200">

    <img src="images/logn-tu.gif" class="sign-contu f-l" />
    <div class="sign-ipt f-l">
        <span id="register">还没账号？赶快<a style="color: #F19F0B" href="http://localhost:81/auth/register.html">注册</a>吧！</span>
        <p>用户名</p>
        <input id="username" value="admin2" type="text" placeholder="手机号/邮箱"/>
        <p>密码</p>
        <input id="password" value="admin2"  type="text" placeholder="请输入密码"/><br/>
        <button class="slig-btn" onclick="loginBut()">登录</button>
        <p>已有账号？请<a href="javascript:void (0)" onclick="loginBut()">登录</a>
            <a href="http://localhost:81/auth/forgetPassword.html" class="wj">忘记密码？</a></p>
        <div class="sign-qx">
            <a href="#" class="f-r"><img src="images/sign-xinlan.gif"/></a>
            <a href="http://localhost:81/oauth/login" class="qq f-r"><img src="images/sign-baidu.gif"/></a>
            <div style="clear:both;"></div>
        </div>
    </div>
    <div style="clear:both;"></div>
</div>

<!--底部服务-->
<div class="ft-service">
    <div class="w1200">
        <div class="sv-con-l2 f-l">
            <dl>
                <dt><a href="#">新手上路</a></dt>
                <dd>
                    <a href="#">购物流程</a>
                    <a href="#">在线支付</a>
                </dd>
            </dl>
            <dl>
                <dt><a href="#">配送方式</a></dt>
                <dd>
                    <a href="#">货到付款区域</a>
                    <a href="#">配送费标准</a>
                </dd>
            </dl>
            <dl>
                <dt><a href="#">购物指南</a></dt>
                <dd>
                    <a href="#">常见问题</a>
                    <a href="#">订购流程</a>
                </dd>
            </dl>
            <dl>
                <dt><a href="#">售后服务</a></dt>
                <dd>
                    <a href="#">售后服务保障</a>
                    <a href="#">退款说明</a>
                    <a href="#">新手选购商品总则</a>
                </dd>
            </dl>
            <dl>
                <dt><a href="#">关于我们</a></dt>
                <dd>
                    <a href="#">投诉与建议</a>
                </dd>
            </dl>
            <div style="clear:both;"></div>
        </div>
        <div class="sv-con-r2 f-r">
            <p class="sv-r-tle">187-8660-5539</p>
            <p>周一至周五9:00-17:30</p>
            <p>（仅收市话费）</p>
            <a href="#" class="zxkf">24小时在线客服</a>
        </div>
        <div style="clear:both;"></div>
    </div>
</div>

<!--底部 版权-->
<div class="footer w1200">
    <p>
        <a href="#">关于我们</a><span>|</span>
        <a href="#">友情链接</a><span>|</span>
        <a href="#">宅客微购社区</a><span>|</span>
        <a href="#">诚征英才</a><span>|</span>
        <a href="#">商家登录</a><span>|</span>
        <a href="#">供应商登录</a><span>|</span>
        <a href="#">热门搜索</a><span>|</span>
        <a href="#">宅客微购新品</a><span>|</span>
        <a href="#">开放平台</a>
    </p>
    <p>
        沪ICP备13044278号<span>|</span>合字B1.B2-20130004<span>|</span>营业执照<span>|</span>互联网药品信息服务资格证<span>|</span>互联网药品交易服务资格证
    </p>
</div>

</body>
</html>